<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>考场签到管理</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, user-scalable=no">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta name=”apple-mobile-web-app-status-bar-style” content=”default” />
    <meta name=”apple-mobile-web-app-status-bar-style” content=”black” />
    <meta name=”apple-mobile-web-app-status-bar-style” content=”black-translucent” />
    <meta content="telephone=no" name="format-detection">
    <meta content="email=no" name="format-detection">
    <meta name="format-detection" content="telephone=no"/>

    <link href="${s.base}/mobile/css/weui.min.css" rel="stylesheet" />
    <link href="${s.base}/mobile/css/jquery-weui.css" rel="stylesheet" />
    <link href="${s.base}/mobile/css/zhkw.css" rel="stylesheet">
    <script type="text/javascript" src="${s.base}/mobile/js/fontSize.js"></script>


</head>
<body>
<div class="main-content75" style="background:#f2f2f2;">
    <div class="menu-nav-ctn clearfix">
        <div class="prebtn" onclick="window.location.go(-1)"><i class="cyfont">&#xe72a;</i></div>
        <ul>
            <li id="allsign">全部</li>
            <li id="waitsign">待签到</li>
            <li id="startsign">未开始</li>
            <li id="endsign">已结束</li>
        </ul>
    </div>
    <div class="exam-details-list" id="my-society-list">
    </div>
</div>
<div class="nodate-ctn" style="display: none">
    <p>
        <img src="${s.base}/mobile/images/nodates.png"><br>
        <span>暂无数据</span>
    </p>
</div>
</body>

<script type="text/javascript" src="${s.base}/mobile/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="${s.base}/mobile/js/fontSize.js"></script>
<script type="text/javascript" src="${s.base}/mobile/js/jquery-weui.js"></script>
<script type="text/javascript" src="${s.base}/mobile/js/fastclick.js"></script>
<script type="text/javascript" src="${s.base}/mobile/js/common.js"></script>
<script type="text/javascript">
    var applyId = '${applyId}';
    var token = '${token}';
    var type = '${type}';

    $(function(){
        initMySocietyData();
    })

    $(".menu-nav-ctn ul li").bind("click",function(){
        $(".menu-nav-ctn ul li").removeClass("checked");
        $(this).addClass("checked")
    })
    function initMySocietyData() {
        $.fn.doPost('/phone/kwmanagement/getTeacherJKList', {applyId:applyId,token:token,type:type}, function (result) {
            if (result.code === 0) {
                postMySocietyData(result.data);
            } else {
                $.toast('获取数据失败', "text");
            }
        });

    }

    function initMySocietyDataNew(typeNew) {
        $.fn.doPost('/phone/kwmanagement/getTeacherJKList', {applyId:applyId,token:token,type:typeNew}, function (result) {
            if (result.code === 0) {
                postMySocietyData(result.data);
            } else {
                $.toast('获取数据失败', "text");
            }
        });

    }




    function postMySocietyData(data) {
        var str = '';
        if (data != null && data.length > 0) {
            for (var i = 0; i < data.length; i++) {
                var newe = data[i];
                    var Str = newe.beginTime.substring(0,16)+"-"+newe.endTime.substring(11,16);


                    if(newe.kwType=="0") {
                        str += '<div class="kw-signin-block" onclick="goSignDetailNew(\''+newe.ksId+'\',\''+newe.kcId+'\',\''+newe.kmId+'\')">';
                        str+=' <div class="signin-type yellow-bg">未开始</div>';

                    }else if (newe.kwType=="1") {
                        str += '<div class="kw-signin-block" onclick="goSignComment(\''+newe.ksId+'\',\''+newe.kcId+'\',\''+newe.kmId+'\')">';
                        str+='<div class="signin-type blue-bg1">待签到</div>';

                    }else if (newe.kwType=="2") {
                        str += '<div class="kw-signin-block" onclick="goSignDetail(\''+newe.ksId+'\',\''+newe.kcId+'\',\''+newe.kmId+'\')">';
                        str+=' <div class="signin-type grey-bg">已结束</div>';
                        //查看签到的详情


                    }
                       str+='<div class="div-line-txt">考试科目：<span>'+newe.kmmc+'</span></div>'+
                        '<div class="div-line-txt">考试时间：<span>'+Str+'</span></div>'+
                        '<div class="div-line-txt">考场号：<span>'+newe.kcNum+'</span></div>'+
                        '<div class="div-line-txt">考场地点：<span>'+newe.kcPlace+'</span></div>'+
                        '<div class="div-line-txt">监考老师：<span>'+newe.jkName+'</span></div>'+
                        '<div class="div-line-txt">巡考老师：<span>'+newe.xkName+'</span></div>'+
                        '</div>';
                }

            }

         $('#nodate-ctn').hide();
        if (isBlank(str)) {
            $('#nodate-ctn').show();
            $('#my-society-list').html(str);
        } else {
            $('#my-society-list').html(str);
        }
    }
    $("#allsign").on("click",function () {
        initMySocietyDataNew("4");

    });
    $("#waitsign").on("click",function () {
        initMySocietyDataNew("1");

    });
    $("#startsign").on("click",function () {
        initMySocietyDataNew("0");

    });
    $("#endsign").on("click",function () {

        initMySocietyDataNew("2");
    });




    function goSignComment(ksId,kcId,kmId){
        window.location.href = "/phone/kwmanagement/kwTeacherSignComment?ksId=" + ksId + "&kcId=" + kcId +"&kmId=" + kmId +
            "&token=${token}&applyId=${applyId}&signType=2";
    }

    function goSignDetail(ksId,kcId,kmId){
        window.location.href = "/phone/kwmanagement/kwTeacherSignDetail?ksId=" + ksId + "&kcId=" + kcId +"&kmId=" + kmId +
            "&token=${token}&applyId=${applyId}&signType=0";
    }

    function goSignDetailNew(ksId,kcId,kmId){
        window.location.href = "/phone/kwmanagement/kwTeacherSignDetail?ksId=" + ksId + "&kcId=" + kcId + "&kmId=" + kmId +
            "&token=${token}&applyId=${applyId}&signType=2";
    }


</script>
</html>
